package org.csmz.class2333.collection;
import java.util.ArrayList;
import java.util.Iterator;
public class Example04 {
    public static void main(String[] args){
        ArrayList list = new ArrayList();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        list.add("鸽鸽");
        Iterator iterator = list.iterator();
        System.out.println("会员列表如下：");
        while (iterator.hasNext()){
            Object obj = iterator.next();
            if(obj.equals("李四")){
                list.remove(obj);
            }
        }
        System.out.println(list);
    }
}
